/* 
 * File:   lattice.cpp
 * Author: mikdebian
 *
 * Created on July 10, 2013, 3:30 AM
 */
#include<stdio.h>

#include "lattice/lattice.hpp"
#include "tersoff/tersoffutils.hpp"
#include "lattice/diamondcubiclat.hpp"
#include "silicontersoff.hpp"
#include "siliconpowell.hpp"

void printLat(const Lattice& lat) {
    for (int i = 0; i < lat.mNA; i++) {
#if 0        
        printf("%d: %lf %lf %lf\n", i, lat.mCoor[i][0], lat.mCoor[i][1], lat.mCoor[i][2]);
#else        
        printf("%lf %lf %lf\n", lat.mCoor[i][0], lat.mCoor[i][1], lat.mCoor[i][2]);
#endif        
    }
}

int main(int argc, char** argv) {

#if 1    
    DiamondCubic sl(1, 3, 5.431);
    Lattice lat;
    sl.fillLattice(lat);
    printLat(lat);
    TersoffParams tpar;
    //SiliconTersoff::fillInParams(tpar);
    //SiliconPowell::fillInParams(tpar);
    //TersoffUtils tutil(&lat, &tpar);
    //double E = tutil.computeEnergy();
    //printf("total energy = %lf, atom energy = %lf\n", E, E / 18);
#else
    for (double a = 4.; a < 8; a += 0.001) {
        DiamondCubic sl(1, 3, a);
        Lattice lat;
        sl.fillLattice(lat);
        //printLat(lat);
        TersoffParams tpar;
        //SiliconTersoff::fillInParams(tpar);
        SiliconPowell::fillInParams(tpar);
        TersoffUtils tutil(&tpar);
        tutil.setLatticeBase(&lat);
        double E = tutil.computeEnergy();
        //printf("%lf %lf\n", a, E / 18);
    }
#endif    
    return 0;
}

